<div class="buttons">
    <a href="<?php echo url('book/new'); ?>">Add</a>
</div>
<table>
    <thead>
	<tr>
	    <th>序号</th>
	    <th>封面</th>
	    <th>书名</th>
	    <th>作者</th>
	    <th>总页数</th>
	    <th>添加时间</th>
	    <th>操作</th>
	</tr>
    </thead>
    <tfoot></tfoor>
    <tbody>
	<?php foreach ($books as $key => $book): ?>
    	<tr class="<?php echo $key % 2 ? 'odd' : ''; ?>">
    	    <td><?php echo $book['id']; ?></td>
    	    <td><img src="<?php echo url('/assets/upload/' . $book['cover']); ?>" alt="<?php echo $book['name']; ?>"/></td>
    	    <td><?php echo $book['name']; ?></td>
    	    <td><?php echo $book['author']; ?></td>
    	    <td><?php echo $book['page']; ?></td>
    	    <td><?php echo date('Y/m/d', $book['created_at']); ?></td>
    	    <td>
    		<a href="<?php echo url('book/delete/' . $book['id']); ?>">Del</a>
    		<a href="<?php echo url('book/edit/' . $book['id']); ?>">Edit</a>
    	    </td>
    	</tr>
	<?php endforeach; ?>
    </tbody>
</table>